package com.tjetc.view.impl;

import com.tjetc.constant.CommonConstant;
import com.tjetc.exception.MessageException;
import com.tjetc.utils.ScannerUtils;
import com.tjetc.view.BookingPage;

/**
 * @Author: itda
 * @Date: 2024/5/10 20:59
 * @Description: BookingPageImpl
 */
public class BookingPageImpl implements BookingPage {
    @Override
    public int show() throws Exception {
        while (true) {
            System.out.println("1.新增预订信息");
            System.out.println("2.删除预订信息");
            System.out.println("3.修改预订信息");
            System.out.println("4.查看预订信息");
            System.out.println("5.返回");
            System.out.println("请输入:");
            int option = ScannerUtils.sc.nextInt();
            if (option<1||option>5){
                throw new MessageException(CommonConstant.COMMAND_ERROR);
            }
            return option;
        }
    }
}
